The functions , , , and provide simple ways of selecting elements from lists and associations by numerical order.
For each South American country, associate the life expectancy of its inhabitants and the gross domestic product (GDP) at purchasing power parity (PPP):
In[1]:=
data=EntityValue,,,"EntityAssociation"
Out[1]=
,,,,,,,,,,,,Missing[NotAvailable],,,,,,,,,,,,,,,
Use to get the two countries with the lowest life expectancy:
In[2]:=
c1=TakeSmallest[data[[All,1]],2]
Out[2]=
,
In[3]:=
c2=TakeLargest[data[[All,2]],2]
Out[3]=
,
Emphasize with colors these two sets of countries on a geographical map:
In[4]:=
GeoGraphics[{Red,Polygon[Keys@c1],Green,Polygon[Keys@c2]}]
Out[4]=